package com.suep.course.repository;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.suep.course.model.CourseManagement;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface CourseRepository extends BaseMapper<CourseManagement> {

    // 查询方法
    @Select("select * from coursemanagement where ${ew.SQLSegment}")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "course_number", column = "course_number"),
            @Result(property = "course_name", column = "course_name"),
            @Result(property = "credit", column = "credit"),
            @Result(property = "class_hours", column = "class_hours")
    })
    List<CourseManagement> SelectFromId(@Param("ew") Wrapper<CourseManagement> queryWrapper);

    @Select("select * from coursemanagement")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "course_number", column = "course_number"),
            @Result(property = "course_name", column = "course_name"),
            @Result(property = "credit", column = "credit"),
            @Result(property = "class_hours", column = "class_hours")
    })
    List<CourseManagement> SelectAll();


}
